from woniuatm_3.user import User
from woniuatm_3.account import Account

# 构建开始菜单
class Menu:
    def __init__(self):
        self.user = User()
        self.account = Account()

    def start_menu(self):

        tip = '''
    ***************** 欢迎来到WoniuATM **********************
    ***************** 请选择操作菜单 ************************
    ************* 1. 注册   2. 登录   3. 退卡 ***************
        '''
        print(tip)
        option = input("请输入你的操作选项：")
        if option == "1":
            self.user.reg()
        elif option == "2":
            self.user.login()
        elif option == "3":
            exit('谢谢，欢迎下次光临.')
        else:
            self.start_menu()

    # 构建登录后业务菜单
    def main_menu(self):
        tip = '''
    *************************** 恭喜登录蜗牛银行 **********************************
    *************************** 请选择操作菜单 ************************************
    ****** 1. 查询   2. 取款   3. 存款   4. 转账   5. 流水  6. 返回  7. 退卡 *******
            '''
        print(tip)
        option = input("请输入你的操作选项：")
        if option == "1":
            self.account.query()
        elif option == "2":
            self.account.withdraw()
        elif option == "3":
            self.account.deposite()
        elif option == "4":
            self.account.transer()
        elif option == "5":
            self.account.history()
        elif option == "6":
            self.start_menu()
        elif option == "7":
            exit('谢谢，欢迎下次光临.')

if __name__ == '__main__':
    Menu().start_menu()